package com.santu.edu.supporter.config;

import okhttp3.ConnectionPool;
import okhttp3.OkHttpClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;

/**
 * @author luoyaoqi
 * @createTime 2024/2/23
 * @description
 */
@Configuration
public class OkHttpClientConfig {


    @Bean
    public OkHttpClient okHttpClient() {
        return new OkHttpClient.Builder()
                .connectionPool(new ConnectionPool(100, 3, TimeUnit.MINUTES))
                .readTimeout(30, TimeUnit.SECONDS)
                .connectTimeout(1, TimeUnit.MINUTES)
                .build();
    }
}
